package com.vidmt.api.modules.sys.entity;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import com.thinkgem.jeesite.common.persistence.DataEntity;

/**
 * {name:TRY, rights:{ vip:{ during:100000, money:10000 } } }
 * 
 * @author xqs
 *
 */
public class Role extends DataEntity {
	private static final long serialVersionUID = 1L;
	@JSONField(serialize = false)
	private String key;
	@JSONField(serialize = false)
	private String nameZh;
	@JSONField(serialize = false)
	private boolean isSys;
	@JSONField(serialize = false)
	private JSONObject rights;

	public Role() {
	}

	public Role(Role role) {
		this.key=role.key;
		this.setRightsJson(role.getRights());
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public JSONObject getRights() {
		return rights;
	}

	public void setRights(String rights) {
		this.rights = JSON.parseObject(rights);
	}

	public String getNameZh() {
		return nameZh;
	}

	public void setNameZh(String nameZh) {
		this.nameZh = nameZh;
	}

	public boolean isSys() {
		return isSys;
	}

	public void setSys(boolean isSys) {
		this.isSys = isSys;
	}

	public void setRightsJson(JSONObject rights) {
		this.rights = rights;
	}
}
